import request from '@/utils/request'

// 青运-安全生产先进单位申报 VO
export interface SafetyExcellenceApplicationVO {
  id: number // 主键编号
  processInstanceId:string
  applicationDate: string|number // 申请时间
  unitName: string // 单位名称
  firstResponsiblePerson: string // 安全生产第一责任人
  annualEvaluationRank: number // 年度考评排名
  mainAchievements: string // 主要事迹简介（单行材料另附）
  expertCommitteeOpinion: string // 安全生产专家委员会意见
  anweiOpinion: string // 集团公司安委会意见
  stamp: string // 签章
  approvalDate: Date // 审批时间
  startUserSelectAssignees:any
  status:number,
  isApproved: any
   [key: string]: any
}

// 青运-安全生产先进单位申报 API
export const SafetyExcellenceApplicationApi = {
  // 查询青运-安全生产先进单位申报分页
  getSafetyExcellenceApplicationPage: async (params: any) => {
    return await request.get({ url: `/bpm/safety-excellence-application/page`, params })
  },

  // 查询青运-安全生产先进单位申报详情
  getSafetyExcellenceApplication: async (id: number) => {
    return await request.get({ url: `/bpm/safety-excellence-application/get?id=` + id })
  },

  // 新增青运-安全生产先进单位申报
  createSafetyExcellenceApplication: async (data: SafetyExcellenceApplicationVO) => {
    return await request.post({ url: `/bpm/safety-excellence-application/create`, data })
  },

  // 修改青运-安全生产先进单位申报
  updateSafetyExcellenceApplication: async (data: SafetyExcellenceApplicationVO) => {
    return await request.put({ url: `/bpm/safety-excellence-application/update`, data })
  },

  // 删除青运-安全生产先进单位申报
  deleteSafetyExcellenceApplication: async (id: number) => {
    return await request.delete({ url: `/bpm/safety-excellence-application/delete?id=` + id })
  },

  // 导出青运-安全生产先进单位申报 Excel
  exportSafetyExcellenceApplication: async (params:any) => {
    return await request.download({ url: `/bpm/safety-excellence-application/export-excel`, params })
  },
}
